<?php
/**
 * $Id: grabarMovimientoProveedorTransferencia.json.php 22 2010-07-16 05:09:41Z corlatti $
 * @author Claudio Corlatti
 *
 */
header ( 'Content-type: application/json' );
require '../library/bootstrap/prepend.php';
IncludeHelper::inc ( 'library/dto/response/GenericResponse.class.php' );
IncludeHelper::inc ( 'library/session/CuentasCostos.class.php' );
IncludeHelper::inc ( 'library/session/Caja.class.php' );

$idCliente = $_POST ['idCliente'];
$banco = $_POST ['banco'];
$importe = $_POST ['importe'];
$moneda = $_POST ['moneda'];
$tipoCambio = $_POST ['tipoCambio'];
$gasto = $_POST ['gasto'];
$fecha = $_POST ['fecha'];
$observaciones = $_POST ['observaciones'];
$costo = $_POST['costo'];
$fechaFija = $_POST['fechaFija'];
$articulo = $_POST['articulo'];
$result = new GenericResponse ( );
try {
	
	$caja = new Caja ( );
	
	$caja->checkRequired ( array ('idCliente' => $idCliente, 'banco' => $banco, 'importe' => $importe,
									'moneda' => $moneda, 'tipoCambio' => $tipoCambio, 'gasto' => $gasto,
									'fecha' => $fecha , 'costo' => $costo) );
	
	$obj = $caja->grabarMovimientoTransferencia ( $idCliente, $banco, $importe, $moneda, $tipoCambio, $gasto, $fecha, $observaciones, $costo, $fechaFija, $articulo );
	$result->result->set ( true, 'OK' );
	$result->valores [0] = $obj;

} catch ( Exception $e ) {
	
	$result->result->set ( false, $e->getMessage () );

}

echo json_encode ( $result );
?>